<!--#include file="../nav/account_top.php" -->
<!--#include file="../nav_menu/account_begin.php" -->
<div class="main_content_title">
	个人资料
	<span class="main_content_title_span">（带<span class="red">*</span>号的项目为必填项）</span>
</div>
<div class="main_content_main">
	<form id="myform" action="" method="post" onsubmit="return false;" >
		<div class="infocontent"> 
			<table class="ggtable" > 
				<tr>
					<td class="label">会员编号：</td>
					<td class="info" >
						 {$rs.username} 
					</td>
				</tr>
				<tr>
					<td class="label">登录密码：</td>
					<td class="info" >
						 ****** <a href="/account/pwd">重置密码</a>
					</td>
				</tr>  
				<tr>
					<td class="label"><span class="red">*</span>姓名：</td>
					<td class="info" >
						<input type="text" class="textBox" id="name" name="name" value="{$rs.name}"  maxlength="10" /> 
					</td>  
				</tr>  
				<tr>
					<td class="label">性别：</td>
					<td class="info" >
						<label class=" ">
							<input type="radio" name="sex" value="男" <?php if($rs['sex'] == '男') echo 'checked="checked"';?> />
							男
						</label>
						<label class=" ">
							<input type="radio" name="sex" value="女" <?php if($rs['sex'] == '女') echo 'checked="checked"';?>  />
							女
						</label>
					</td>  
				</tr>   
				<tr>
					<td class="label">手机号码：</td>
					<td class="info" >
						<input type="text" class="textBox" id="phone" name="phone" value="{$rs.phone}"  maxlength="11"  style="width:200px"   /> 
					</td>    
				</tr>  
				<tr>
					<td class="label">Email：</td>
					<td class="info" >
						<input type="text" class="textBox" id="email" name="email" value="{$rs.email}"  maxlength="100" style="width:200px" /> 
					</td>  
				</tr>
					<tr>
						<td class="label">  </td>
						<td class="info">
							<button onclick="fnSave()" class="btn_green">保 存</button> 
							<button onclick="fnReturn()" class="btn_gray">返 回</button> 
						</td>
					</tr> 
			</table> 
		</div>
	</form>
</div>		
<script type="text/javascript">
var url_save = '/account/info'; 
var url_return = '/account/index'; 
$().ready(function(){
	$('#name').focus();
});
function fnSave(){
	var form = serializeObj("#myform");
	if($.trim(form.name) == ''){
		ymPrompt.alert({message:'请输入姓名',handler:function(){
			$('#name').focus();
		}});
		return false;
	}	
	if(!form.sex){
		ymPrompt.alert({message:'请选择性别',handler:function(){
			$('#name').focus();
		}});
		return false;
	}

	if($('#phone').val()!='' && !fnRegExp('reg_mobile',$('#phone').val())){
		ymPrompt.alert({message:'手机号码格式有误，请重新输入',handler:function(){
			$('#phone').focus();
		}});
		return false;
	}
	if($('#email').val()!='' && !fnRegExp('reg_email',$('#email').val())){
		ymPrompt.alert({message:'Email有误，请重新输入',handler:function(){
			$('#email').focus();
		}});
		return false;
	}
	$('button').attr('disabled','disabled');
	fnLoading();
	$.post(
		url_save,
		{
			form:JSON.encode(form)
		},
		function(e){
			fnLoadingEnd();
			var ok = errorHandler(e); 
			if(ok && ok.success=='1'){
				jumpTo(url_return);
			}else{
				$('button').attr('disabled','');
			}	
		}
	);
	return false;
}
function fnReturn(){
	jumpTo(url_return);
}
</script>

<!--#include file="../nav_menu/account_end.php" -->
<!--#include file="../nav/account_bottom.php" -->